home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / pine3.92 / contrib / carmel / imapd / imapd.c.patch.old
Text File  |  1993-07-18  |  3KB  |  111 lines

  1. *** imapd.c    Sun Jul 18 21:48:29 1993
  2. --- imapd.c.new    Sun Jul 18 21:47:53 1993
  3. ***************
  4. *** 109,115 ****
  5. --- 109,119 ----
  6.   extern DRIVER bezerkdriver,tenexdriver,imapdriver,newsdriver,nntpdriver,
  7.     dummydriver;
  8.   
  9. + #ifdef BWC
  10. + extern DRIVER carmeldriver, carmel2driver;
  11. + #endif
  12.   
  13.   /* Function prototypes */
  14.   
  15.   void main  ();
  16. ***************
  17. *** 135,140 ****
  18. --- 139,148 ----
  19.   long cstring  ();
  20.   long caddr  ();
  21.   
  22. + #ifdef BWC
  23. + char *glyph2richtext();
  24. + #endif
  25.   extern char *crypt  ();
  26.   
  27.   /* Main program */
  28. ***************
  29. *** 147,152 ****
  30. --- 155,164 ----
  31.     char *s,*t = "OK",*u,*v;
  32.     struct hostent *hst;
  33.     void (*f) () = NIL;
  34. + #ifdef BWC
  35. +   mail_link (&carmeldriver);
  36. +   mail_link (&carmel2driver);
  37. + #endif  
  38.     mail_link (&tenexdriver);    /* install the Tenex mail driver */
  39.     mail_link (&bezerkdriver);    /* install the Berkeley mail driver */
  40.     mail_link (&imapdriver);    /* install the IMAP driver */
  41. ***************
  42. *** 164,170 ****
  43. --- 176,186 ----
  44.       state = SELECT;        /* enter select state */
  45.       t = "PREAUTH";        /* pre-authorized */
  46.     }
  47. + #ifdef BWC
  48. +   printf ("* %s %s IMAP2bis Service %sBWC at %s\015\012",t,host,version,cmdbuf);
  49. + #else
  50.     printf ("* %s %s IMAP2bis Service %s at %s\015\012",t,host,version,cmdbuf);
  51. + #endif
  52.     fflush (stdout);        /* dump output buffer */
  53.     signal (SIGALRM,clkint);    /* prepare for clock interrupt */
  54.     signal (SIGUSR2,kodint);    /* prepare for Kiss Of Death */
  55. ***************
  56. *** 782,788 ****
  57. --- 798,817 ----
  58.     if (body && (s = mail_fetchbody (stream,i,s,&j))) {
  59.                   /* and literal string */
  60.       printf ("{%d}\015\012",j);
  61. + #ifdef BWC_NOT_WORKING_YET
  62. +     {
  63. +         char *ss;
  64. +         s[j] = '\0';
  65. +         s = glyph2richtext(s);
  66. +         j = strlen(s);
  67. +         ss = rfc822_8bit(s, j, &j);
  68. +         fs_give((void **)&s);
  69. +         while (j -= k) k = fwrite (ss += k,1,j,stdout);
  70. +         fs_give((void **)&ss);
  71. +     }
  72. + #else    
  73.       while (j -= k) k = fwrite (s += k,1,j,stdout);
  74. + #endif
  75.       changed_flags (i,f);    /* output changed flags */
  76.     }
  77.     else fputs ("NIL",stdout);    /* can't output anything at all */
  78. ***************
  79. *** 983,995 ****
  80. --- 1012,1039 ----
  81.       else {            /* non-multipart body type */
  82.         pstring ((char *) body_types[body->type]);
  83.         putchar (' ');
  84. + #ifdef BWC
  85. +       if(body->type == TYPETEXT && strcmp(lcase(body->subtype), "x-bwc-glyph") == 0)
  86. +         pstring("plain"); /* Make it plain now, richtext later when fixed */
  87. +       else
  88. +         pstring (body->subtype);
  89. + #else
  90.         pstring (body->subtype);
  91. + #endif
  92.         if (param = body->parameter) {
  93.       fputs (" (",stdout);
  94.       do {
  95.         pstring (param->attribute);
  96.         putchar (' ');
  97. + #ifdef BWC_NOT_WORKING_YET
  98. +           if(strucmp2(param->attribute, "charset") == 0) {
  99. +               pstring("ISO-8859-1");
  100. +           } else {
  101. +               pstring (param->value);
  102. +           }
  103. + #else
  104.         pstring (param->value);
  105. + #endif
  106.         if (param = param->next) putchar (' ');
  107.       } while (param);
  108.       fputs (") ",stdout);
  109.